import 'package:bxultimate/shared/shared.dart';
import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';

import 'state.dart';

class ServerUrlSettingController extends GetxController {
  final ServerUrlSettingState state = ServerUrlSettingState();

  TextEditingController serverUrlController = TextEditingController();

  @override
  void onInit() {
    // TODO: implement onInit
    super.onInit();

    serverUrlController.text = UtilSp.getString(AppConstant.SERVER_URL)!;
  }

  void save() async {
    await UtilSp.putString(AppConstant.SERVER_URL, serverUrlController.text);
    Get.back();
  }
}
